package com.example.shopsystem.service;

import com.example.shopsystem.dao.BusinessMapper;
import com.example.shopsystem.dao.GoodMapper;
import com.example.shopsystem.dao.OrderMapper;
import com.example.shopsystem.dao.UserMapper;
import com.example.shopsystem.entity.Good;
import com.example.shopsystem.service.Impl.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodServiceImpl implements GoodService {
    @Autowired
    UserMapper userMapper;
    @Autowired
    GoodMapper goodMapper;
    @Autowired
    OrderMapper orderMapper;
    @Autowired
    BusinessMapper businessMapper;

    @Override
    public List<Good> ViewProductList() {
        return goodMapper.ViewProductList();
    }//返回所有商品

    @Override
    public Good viewItem(String goodId) {
        return goodMapper.viewItem(goodId);
    }

    @Override
    public List<Good> queryGood(String goodName) {
        System.out.println(goodName);
        System.out.println(goodMapper.queryGood(goodName));
        return goodMapper.queryGood(goodName);
    }

    @Override
    public List<Good> viewGoods() {
        return goodMapper.viewGoodList();
    }
}
